<!DOCTYPE html>
<%@ include file="/common/taglibs.jsp"%>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title><fmt:message key="webapp.name" /> | <fmt:message key="patentDetails.title" /></title>
</head>
<body>
<div id="patDetailsContainer">
    <div align="center">
        <h1><fmt:message key="search.title" /></h1>
    </div>
    <br>
    <div id="linkNewSearch">
        <a href="javascript:window.history.back();"><fmt:message key="link.back" /></a>&nbsp;
        <a href="${ctx}/patentsearch.jsp"><fmt:message key="link.newsearch" /></a>
    </div>
    <br>
    <c:if test="${result.patTitle == null}">
        <center>
            <b><font size="+2">Sorry...This patent is not in our database.</font></b>
        </center>
    </c:if>
    <c:if test="${result.patTitle != null}">
    <div>
        <hr/>
        <font size="+2"><c:out value="${result.patTitle}"/></font>
        <hr/>
        <c:if test="${result.patAbstract != null}">
        <br/>
        <center>
            <b><font size="+1">Abstract</font></b>
        </center>
        <p><c:out value="${result.patAbstract}"/></p>
        <hr/>
        </c:if>
        <table width="100%">
            <tbody>
                <tr>
                    <th align="LEFT" width="18%">Patent number</th>
                    <td align="LEFT" width="82%"><c:out value="${result.patNumber}"/></td>
                </tr>
                <tr>
                    <th align="LEFT">Filing date</th>
                    <td align="LEFT"><c:out value="${result.patFiledDate}"/></td>
                </tr>
                <tr>
                    <th scope="row" valign="TOP" align="LEFT">Issue date</th>
                    <td align="LEFT"><c:out value="${result.patIssuedDate}"/></td>
                </tr>
                <tr>
                    <th scope="row" valign="TOP" align="LEFT">Application number</th>
                    <td align="LEFT"><c:out value="${result.patApplNo}"/></td>
                </tr>
            </tbody>
        </table>
        <hr>
        <table width="100%">
            <tbody>
                <tr>
                    <th scope="row" valign="TOP" align="LEFT" width="18%">Inventors</th>
                    <td align="LEFT" width="82%">
                        <c:forEach items="${result.patInventors}" var="inventor" varStatus="loop">
                            ${inventor}<c:if test="${!loop.last}">, </c:if>
                        </c:forEach>
                    </td>
                </tr>
                <tr>
                    <th scope="row" valign="TOP" align="LEFT" width="18%">Assignees</th>
                    <td align="LEFT" width="82%">
                        <c:forEach items="${result.patAssignees}" var="assignee" varStatus="loop">
                            ${assignee}<c:if test="${!loop.last}">, </c:if><c:if test="${loop.last}">.</c:if>
                        </c:forEach>
                    <br></td>
                </tr>
            </tbody>
        </table>
        <hr>
        <table width="100%">
            <tbody>
                <tr>
                    <th valign="TOP" align="LEFT" width="18%">Current U.S. Classification</th>
                    <td valign="TOP" align="LEFT" width="82%">
                        <c:forEach items="${result.patUSClasses}" var="usclass" varStatus="loop">
                            ${usclass}<c:if test="${!loop.last}">; </c:if><c:if test="${loop.last}">.</c:if>
                        </c:forEach>
                    </td>
                </tr>
                <tr>
                    <th valign="TOP" align="LEFT" width="18%">International Classification</th>
                    <td valign="TOP" align="LEFT" width="82%">
                        <c:forEach items="${result.patIntClasses}" var="intclass" varStatus="loop">
                            ${intclass}<c:if test="${!loop.last}">; </c:if><c:if test="${loop.last}">.</c:if>
                        </c:forEach>
                    </td>
                </tr>
            </tbody>
        </table>
        <br>
        <!-- Citations-->
        <hr>
        <center>
            <b><font size="+1">Citations</font></b>
        </center>
        <hr>
        <table width="100%">
            <tbody>
                <tr>
                    <th align="left" scope="col" width="15%">Cited Patent</th>
                    <th align="left" scope="col" width="15%">Filing date</th>
                    <th align="left" scope="col" width="15%">Issue date</th>
                    <th align="left" scope="col" width="15%">Assignee</th>
                    <th align="left" scope="col" width="40%">Title</th>
                </tr>
                <c:forEach items="${result.patentsRefTo}" var="patentRefTo" varStatus="loop">
                <tr>
                    <td align="left">
                        <c:if test="${not empty patentRefTo.patTitle}">
                            <a href="${ctx}/patents?patNum=${patentRefTo.patNumber}">${patentRefTo.patNumber}</a>
                        </c:if>
                        <c:if test="${empty patentRefTo.patTitle}">
                            <span>${patentRefTo.patNumber}</span>
                        </c:if>
                    </td>
                    <td align="left">${patentRefTo.patFiledDate}</td>
                    <td align="left">${patentRefTo.patIssuedDate}</td>
                    <td align="left">
                        <c:forEach items="${patentRefTo.patAssignees}" var="assignee" varStatus="loop">
                            ${assignee}<c:if test="${!loop.last}">; </c:if>
                        </c:forEach>
                    </td>
                    <td align="left">${patentRefTo.patTitle}</td>
                </tr>
                </c:forEach>
            </tbody>
        </table>
        <br>
        <!-- Referenced By -->
        <hr>
        <center>
            <b><font size="+1">Referenced by</font></b>
        </center>
        <hr>
        <table width="100%">
            <tbody>
                <tr>
                    <th align="left" scope="col" width="15%">Citing Patent</th>
                    <th align="left" scope="col" width="15%">Filing date</th>
                    <th align="left" scope="col" width="15%">Issue date</th>
                    <th align="left" scope="col" width="15%">Assignee</th>
                    <th align="left" scope="col" width="40%">Title</th>
                </tr>
                <c:forEach items="${result.patentsRefBy}" var="patentRefBy" varStatus="loop">
                <tr>
                    <td align="left">
                        <a href="${ctx}/patents?patNum=${patentRefBy.patNumber}">${patentRefBy.patNumber}</a>
                    </td>
                    <td align="left">${patentRefBy.patFiledDate}</td>
                    <td align="left">${patentRefBy.patIssuedDate}</td>
                    <td align="left">
                        <c:forEach items="${patentRefBy.patAssignees}" var="assignee" varStatus="loop">
                            ${assignee}<c:if test="${!loop.last}">; </c:if>
                        </c:forEach>
                    </td>
                    <td align="left">${patentRefBy.patTitle}</td>
                </tr>
                </c:forEach>
            </tbody>
        </table>
        <br>
        <br>
        <hr/>
        <center>
            <b><font size="+1">Claims</font></b>
        </center>
        <hr/>
        <br/>
        <c:forEach items="${result.patClaims}" var="claim" varStatus="loop">
                        ${loop.count}.    ${claim}
            <br/>
            <br/>
        </c:forEach>
        <hr/>
        <center>
            <b><font size="+1">Description</font></b>
        </center>
        <hr/>
        <div style="width: 100%;  word-wrap: break-word;">
            <pre><font face="Times New Roman"><c:out value="${result.patDesc}"/></font></pre>
        </div>
        <br/>
        <center>
            <b>* * * * *</b>
        </center>
        <hr>
    </div>
    </c:if>
</div>
</body>
</html>